package goover.unit04;

import java.io.File;

public class FileDemo04 {
    public static void main(String[] args){
        File file = new File("D:\\新建文件夹");
        deleteDir(file);
    }
    public static void deleteDir(File file){
        File[] listFiles = file.listFiles();
        for(File files : listFiles){
            if(files.isDirectory()){
                deleteDir(files);
            }else {
                files.delete();
            }
        }
        file.delete();
    }
}
